#include <stdio.h>
#include <math.h>

int test() 
{
    // 三角函数
    double angle = 45.0 * M_PI / 180.0; // 将角度转换为弧度
    printf("sin(45 degrees) = %f\n", sin(angle));
    printf("cos(45 degrees) = %f\n", cos(angle));
    printf("tan(45 degrees) = %f\n", tan(angle));
    printf("asin(0.5) = %f\n", asin(0.5));
    printf("acos(0.5) = %f\n", acos(0.5));
    printf("atan(1.0) = %f\n", atan(1.0));

    // 双曲函数
    printf("sinh(1.0) = %f\n", sinh(1.0));
    printf("cosh(1.0) = %f\n", cosh(1.0));
    printf("tanh(1.0) = %f\n", tanh(1.0));
    printf("asinh(1.0) = %f\n", asinh(1.0));
    printf("acosh(2.0) = %f\n", acosh(2.0));
    printf("atanh(0.5) = %f\n", atanh(0.5));

    // 指数和对数函数
    printf("exp(1.0) = %f\n", exp(1.0));
    printf("log(10.0) = %f\n", log(10.0));
    printf("log10(100.0) = %f\n", log10(100.0));
    printf("pow(2, 3) = %f\n", pow(2, 3));
    printf("sqrt(25.0) = %f\n", sqrt(25.0));

    // 取整函数
    double value = 3.14;
    printf("ceil(3.14) = %f\n", ceil(value));
    printf("floor(3.14) = %f\n", floor(value));
    printf("round(3.14) = %f\n", round(value));

    // 其他
    printf("fabs(-5.67) = %f\n", fabs(-5.67));
    printf("fmod(5.0, 2.0) = %f\n", fmod(5.0, 2.0));
    printf("remainder(10.0, 3.0) = %f\n", remainder(10.0, 3.0));

    return 0;
}


int main (void)
{
  double radians;

  for (radians = -0.5; radians <= 0.5; radians += 0.2)
    printf("%f %f\n", radians, acos(radians));

  double x = 1.0;
  double result = cosh(x);
  printf("The hyperbolic cosine of %f is %f\n", x, result);

  double power = pow(2, 3);
  double rounded = round(3.14);
  double absolute = fabs(-5.67);

  printf("2^3 = %f\n", power);
  printf("Rounded value of 3.14 = %f\n", rounded);
  printf("Absolute value of -5.67 = %f\n", absolute);

  test();
  
  return 0;
}
